package net.lzzy.practices.wed.models;

import lombok.Getter;
import lombok.Setter;
import net.lzzy.practices.entities.Option;

import java.util.UUID;

@Getter
@Setter
public class VmOption {
    private UUID id;
    private String content;
    private String label;
    private Boolean answer;
    private UUID questionId;

    private VmOption(){}

    public static VmOption create(Option option,boolean teacher){
        VmOption vm = new VmOption();
        vm.setId(option.getId());
        vm.setAnswer(teacher ? option.isAnswer() : null);
        vm.setLabel(option.getLabel());
        vm.setQuestionId(option.getQuestion().getId());
        return vm;
    }
}
